package cn.demengsite.service.impl;

import cn.demengsite.dao.AttributeDAO;
import cn.demengsite.dao.VendorDAO;
import cn.demengsite.model.Attribute;
import cn.demengsite.model.BaseInfo;
import cn.demengsite.model.VendorProduct;
import cn.demengsite.service.AttributeService;
import cn.demengsite.service.VendorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;


@Repository
public class AttributeServiceImpl implements AttributeService {

    @Autowired
    private AttributeDAO attributeDAO;


    @Override
    public BaseInfo getAllAttribute() {
        return new BaseInfo("0","30",attributeDAO.getAllAttribute());
    }

    @Override
    public BaseInfo newAttribute(Attribute attribute) {
        attributeDAO.newAttribute(attribute);
        return new BaseInfo("0","OK");
    }

    @Override
    public BaseInfo updateAttribute(Attribute attribute) {
        attributeDAO.updateAttribute(attribute);
        return new BaseInfo("0","OK");
    }

    @Override
    public BaseInfo getSubAttribute(Attribute attribute) {
        //获取一个属性的下面的属性，根据id进行判断

        return null;
    }
}
